package com.daohang361.imqq.hotLoader;

import com.daohang361.imqq.plugins.InterfacePlugin;

/** 
 * @author naner E-mail:likun3344@163.com 
 * @create time：2011-5-19 下午07:45:14 
 */
public class PuginManager {
	public static InterfacePlugin GetPuginByKey(String key){
		 try {
			 System.out.println("ClassKey:"+key);
			ClassManager manager = new ClassManager();
			InterfacePlugin pugin = (InterfacePlugin) 
			manager.getInstanceProxy(ClassManager.getSysAttribute(key));
			System.out.println(pugin);
			return pugin;
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println("获取失败");
		}
		return null;
	}
	
	public static Object GetPuginObjectByKey(String key){
		 try {
			ClassManager manager = new ClassManager();
			Object pugin =manager.getInstanceProxy(ClassManager.getSysAttribute(key));
			System.out.println(pugin);
			return pugin;
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println("获取失败");
		}
		return null;
	}
	
	public static Object GetPuginByClassName(String className){
		 try {
			ClassManager manager = new ClassManager();
			return manager.getInstanceProxy(className);
		} catch (Exception e) {
			System.out.println("获取失败");
		}
		return null;
	}
}
